home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
editor
/
par.zip
/
EXAMPL20.POM
< prev
next >
Wrap
Text File
|
1997-06-27
|
1KB
|
42 lines
PROLOGUE
;
; Read the file 20 bytes at a time
;
CHOP 1 20
;
; Set up the maps
;
MAPFILE "BIN2CODE.MPF" "CODE"
MAPFILE "BIN2CHAR.MPF" "CHAR"
;
; Programming Tip: The CHOP and MAPFILE commands do not have to go in
; a PROLOGUE section. Parse-O-Matic is designed to ignore commands that
; have lost their relevance. For example, the MAPFILE data is not read
; in repeatedly if you place it in the regular POM code; Parse-O-Matic
; checks first to see if it already has the map. However, if you only
; plan to do something once at the very beginning of a parsing job, it
; is good "programming style" to place it in a PROLOGUE, even if it
; only saves you a few hundredths of a second in processing time.
;
END
;
; Pad out the data if we have less than 20 bytes
;
SETLEN data_len $FLINE
BEGIN data_len <> "20"
PAD $FLINE "R" #0 "20"
END
;
; Make a copy of the data
;
SET x = $FLINE
;
; Remap the strings
;
REMAP $FLINE "CODE"
REMAP x "CHAR"
;
; Output
;
OUTEND |{$FLINE}{x}